package com.fxy.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

import java.util.ArrayList;

@Configuration
@EnableSwagger2  //开启swagger
public class SwaggerConfig {
    @Bean
    public Docket docker() {
        return new Docket(DocumentationType.SWAGGER_2)
                .apiInfo(apiInfo());
    }

    private ApiInfo apiInfo() {

        Contact contact = new Contact("付新宇","846510744@qq.com","846510744@qq.com");

        return new ApiInfo(
                "springbootdome测试接口",  //名字
                "第一个springboot程序", //描述
                "1.0", //版本号
                "www.baidu.com",
                contact,
                "fxy",
                "http://www.apache.org/licenses/LICENSE-2.0",
                new ArrayList()
        );

    }

}
